﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lamex.Library.UserCotrolUI;
using DevExpress.XtraEditors;
using Lamex.Base;
using Lamex.Common;
using AxWMPLib;
using System.Data;
using System.Windows.Forms;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;

namespace Lamex.mMES.Common
{
    public class ShowHelper
    {
        //滚动显示信息值
        public static void ShowLblInfo(LabelControl lblInfo_1, LabelControl lblInfo_2, LabelControl lblInfo_3, LabelControl lblInfo_4)
        {
            string lbl1 = lblInfo_1.Text;
            string lbl2 = lblInfo_2.Text;
            string lbl3 = lblInfo_3.Text;
            string lbl4 = lblInfo_4.Text;
            lblInfo_3.Text = lbl4;
            lblInfo_2.Text = lbl3;
            lblInfo_1.Text = lbl2;

        }
        //显示所有信息值
        public static void ShowAllInfo(string Error, LabelControl lblInfo_1, LabelControl lblInfo_2, LabelControl lblInfo_3, LabelControl lblInfo_4)
        {
            ShowLblInfo(lblInfo_1, lblInfo_2, lblInfo_3, lblInfo_4);
            lblInfo_4.Text = Error;
        }

        public static void GetDisplayInfo(DataTable dtUI, GridControl gcMid_B, GridView gridView1)
        {
            if (dtUI.Rows.Count > 0)
            {
                DataView dv = dtUI.DefaultView;
                dv.Sort = "SCAN_TIME Desc";
                dtUI = dv.ToTable();
                gcMid_B.DataSource = dtUI;
                gridView1.BestFitColumns();
                gridView1.OptionsView.ColumnAutoWidth = false;

            }
        }
    }
}
